Skip to content

feat(setup-js): support pnpm/setup for pnpm > 11 - #21

Merged
northword merged 9 commits into
mainfrom
feat/pnpm-setup
Aug 31, 2026
Merged

feat(setup-js): support pnpm/setup for pnpm > 11#21
northword merged 9 commits into
mainfrom
feat/pnpm-setup

Conversation

@northword

@northword northword commented Aug 31, 2026

Copy link
Copy Markdown
Member

Closes #20

What

setup-js auto-detects the toolchain and picks a setup strategy:

Detected Path
Vite+ (vite-plus in devDependencies) voidzero-dev/setup-vp@v1
pnpm > 11, or undeclared pnpm version (resolves to latest) pnpm/setup@v2 — installs pnpm + Node.js runtime in one step
npm / yarn / pnpm ≤ 11 setup-node (internal; pnpm/action-setup@v6 for pnpm)

The > 11 boundary is deliberate: pnpm/setup only supports pnpm >= 11, and v11 ships no binary for Intel macOS (darwin-x64) — keeping v11 on the classic path avoids that.

Changes

  • setup-js/action.yml
    • steps grouped as Checkout / Detect / Setup; semantic detect ids detect-vp / detect-pm / detect-pnpm, outputting use_vp, pm, use_new_pnpm
    • package-manager detection moved here from setup-node; pnpm major parsed from packageManager / devEngines.packageManager (handles ^12.0.0, +sha256..., 12.x, minified JSON)
    • pm detection skipped when Vite+ is used; pnpm strategy skipped unless pm == pnpm
    • new pnpm/setup step: runtime derived from node-version inline (lts/*node@lts), install/cache forwarded
    • voidzero-dev/setup-vp@v1 called directly (was the setup-vp wrapper)
    • each detect step logs its own result (no forward references)
  • setup-node: internal — duplicated package-manager detection removed, package-manager becomes a required input (always supplied by setup-js)
  • setup-vp: deleted (was a pure passthrough wrapper)
  • setup-js/example.yml, README.md: updated (README lists the three setup paths)

Notes

  • Detection and gating matrix verified locally (pnpm 10/11/12, ranges, hashes, no declarations, forced npm, Vite+ repos, …)
  • Existing consumers (autofix / release-npm / release-plugin, tracking @main) pass no package-manager input; current behavior is preserved unless their pnpm version is > 11 or undeclared

Auto-detect the package manager and the declared pnpm version in
setup-js, then pick the toolchain:

- pnpm > 11 (or undeclared pnpm version, which resolves to latest):
  pnpm/setup@v2, which installs pnpm and the Node.js runtime in one
  step (node-version is mapped to its runtime input; lts/* -> lts)
- otherwise (npm/yarn, or pnpm <= 11): the classic setup-node path
  (pnpm/action-setup), unchanged

pnpm/setup only supports pnpm >= 11, and v11 ships no binary for
Intel macOS runners, hence the > 11 boundary. The detected package
manager is passed to setup-node to avoid a second detection pass.
setup-node is an internal building block of setup-js, which now always
detects the package manager and passes it in. Remove the duplicated
lockfile detection and make `package-manager` a required input.
- package-manager detection and pnpm version/strategy detection are now
  separate steps (detect / pnpm-strategy)
- drop the node_runtime output: the node-version -> pnpm/setup runtime
  mapping is inlined into the pnpm/setup step's `runtime` input
  ('' or lts/* -> node@lts, otherwise node@<version>)
Gate the pnpm-strategy step on pm == 'pnpm' and drop the now-redundant
inner guard. When the step is skipped (npm/yarn), its output is empty,
which the downstream conditions already handle ('' != 'true' keeps the
classic setup-node path).
setup-vp was a pure passthrough of version/run-install/cache to
voidzero-dev/setup-vp@v1. Call it directly from setup-js like
pnpm/setup, and delete the wrapper. The setup-js input surface
(vp/vp-version/auto-install/cache) is unchanged.
and add Checkout / Detect / Setup section separators to setup-js steps.
…sage

- rename detect step ids: vp -> detect-vp, detect -> detect-pm,
  pnpm-strategy -> detect-pnpm
- skip package-manager and pnpm strategy detection when Vite+ is used
  (detect-pm gated on use_vp != 'true', detect-pnpm additionally on
  pm == 'pnpm'); all downstream references updated
Each detect step now logs its own outcome (Vite+ usage, package
manager, detected pnpm version and strategy). Drop the old log lines
that announced subsequent steps in advance.
@northword
northword merged commit 2385fb3 into main Aug 31, 2026
1 check passed
@northword
northword deleted the feat/pnpm-setup branch August 31, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use new pnpm/setup action to install pnpm

1 participant